package com.naiterui.ehp.bs.b2c.order.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Version;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * <pre>
 *      订单用户表
 * </pre>
 *
 * @author zhouyanxin
 * @date 2019/1/11 下午11:19
 * @since 1.0.0
 */
@Data
@Builder
@Entity
@AllArgsConstructor
@NoArgsConstructor
@Table(name = "e_order_user")
public class OrderUser implements java.io.Serializable {

    /**
     * 订单类型 购物订单
     */
    public static final int ORDER_TYPE_SHOPPING = 0;
    /**
     * 订单类型 退货订单
     */
    public static final int ORDER_TYPE_RETURN_GOODS = 1;
    private static final long serialVersionUID = -7760777359858081563L;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id", nullable = false)
    private Long id;

    /**
     * 订单ID
     */
    @Column(name = "order_id", nullable = false)
    private Long orderId;
    /**
     * 订单类型 0:购物订单  1:退货订单
     */
    @Column(name = "type", nullable = false)
    private Integer type;
    /**
     * 收货人
     */
    @Column(name = "receiver", nullable = false, length = 40)
    private String receiver;
    /**
     * 省
     */
    @Column(name = "provice", nullable = false, length = 10)
    private String provice;
    /**
     * 市
     */
    @Column(name = "city", nullable = false, length = 10)
    private String city;
    /**
     * 县
     */
    @Column(name = "country", nullable = false, length = 10)
    private String country;

    /**
     * 城市ID
     */
    @Column(name = "city_id", nullable = false)
    private Long cityId;

    /**
     * 详细地址
     */
    @Column(name = "address", nullable = false, length = 100)
    private String address;
    /**
     * 邮编
     */
    @Column(name = "zipcode", nullable = true, length = 10)
    private String zipcode;
    /**
     * 电话
     */
    @Column(name = "phone", nullable = true, length = 20)
    private String phone;

    /**
     * 创建时间
     */
    @Column(name = "created_at")
    private Date createdAt;

    /**
     * 创建人
     */
    @Column(name = "created_by")
    private String createdBy;

    /**
     * 修改时间
     */
    @Column(name = "changed_at")
    private Date changedAt;

    /**
     * 修改人
     */
    @Column(name = "changed_by")
    private String changedBy;

    /**
     * 乐观锁
     */
    @Version
    private Integer version;

}
